package com.dwin.navy.serialportapi;

import android.util.Log;

import com.log.LatteLogger;

import java.io.FileDescriptor;

public class SerialPortJNI
{
  public FileDescriptor mFd;
  public int mDevNum;
  public int mSpeed;
  public int mDataBits;
  public int mStopBits;
  public int mParity;
  
  public native int setSpeed(FileDescriptor paramFileDescriptor, int paramInt);
  
  public native int setParity(FileDescriptor paramFileDescriptor, int paramInt1, int paramInt2, int paramInt3);
  
  public native FileDescriptor openDev(int paramInt);
  
  public native FileDescriptor open485Dev(int paramInt);
  
  public native int closeDev(FileDescriptor paramFileDescriptor);
  
  public native int close485Dev(FileDescriptor paramFileDescriptor);
  
  public native int readBytes(FileDescriptor paramFileDescriptor, byte[] paramArrayOfByte, int paramInt);
  
  public native boolean writeBytes(FileDescriptor paramFileDescriptor, byte[] paramArrayOfByte, int paramInt);
  
  public native int set485mod(int paramInt);
  
  static
  {
    LatteLogger.i("NativeClass", "before load library");
    try
    {
      System.loadLibrary("serialport");

    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
    LatteLogger.i("NativeClass", "after load library");
  }
  
  public int RS485ModFp = -1;
  public static int RS485Read = 0;
  public static int RS485Write = 1;
}
